package study.job.spring.job;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import study.job.spring.service.AsyncService;
import study.job.spring.support.trace.JobTrace;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

@Slf4j
//@Component
public class _9_TraceJob {

    private static ExecutorService POOL = Executors.newFixedThreadPool(5);

    @Autowired
    private AsyncService asyncService;

    /**
     * （1）
     */
    @JobTrace(name = "1231")
    @Scheduled(cron = "0/5 * * * * ?")
    public void doAsyncJob_01() {
        log.info(">>>>>>>>>> start");
        POOL.submit(() -> {
        });
        log.info(">>>>>>>>>> end");
    }
}
